package demo3;

//通话套餐类
public class CallPackage extends Package implements CallSrvInterFace {
    private  int calltime; //通话时长
    private int mgscnt; //短信条数

    public CallPackage() {
    }

    public CallPackage(int calltime, int mgscnt) {
        setCalltime(calltime);
        setMgscnt(mgscnt);
    }

    public int getCalltime() {
        return calltime;
    }

    public int getMgscnt() {
        return mgscnt;
    }

    public void setCalltime(int calltime) {
        this.calltime = calltime;
    }

    public void setMgscnt(int mgscnt) {
        this.mgscnt = mgscnt;
    }

    //显示所有套餐信息
    public void callPackagesShow(){
        System.out.println("通话时长:" + getCalltime() + "分钟 短信条数:" + getMgscnt() + " 每月资费:" + getRate());
    }

    //重写抽象类里的方法
    @Override
    public void showRate() {
        System.out.println("重写抽象类中方法 每月资费"+getRate());
    }

    @Override
    public void callSrvShow(int calltime, PhoneCardType cardType) {
        String ct = cardType.getCtype();
        System.out.println("通话套餐类中通话服务接口的实现：" + ct + "通话时长:" + calltime);
    }
}
